package edu.gyc.rbacdb.controller;


import edu.gyc.rbacdb.model.User;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ls
 * @since 2019-12-06
 */
@RestController

public class UserController {

    @GetMapping("/dba/girl")
    public Object dba() {
       User user= (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user.getUsername()+" get all ol girls.especially get 赵雨静";
    }

    @GetMapping("/admin/girl")
    public Object admin() {
        User user= (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user.getUsername()+" get all advance ol girls.";
    }

    @GetMapping("/lover/girl")
    public Object lover() {
        User user= (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return user.getUsername()+" get all advance Lovers.";
    }
}

